import VueRouter from "vue-router"

import Layout from "@/layout/Layout";





// 静态路由
export const staticRoutes = [
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: "/home",
        children: [
            {
                path: 'home',
                name: 'wel',
                component: () => import("@/views/Home"),
            },
            {
                path: 'toolType',
                name: 'toolType',
                component: () => import("@/views/toolType"),
            },
            {
                path: 'supply',
                name: 'supply',
                component: () => import("@/views/supply"),
            },
            {
                path: 'tool',
                name: 'tool',
                component: () => import("@/views/tool"),
            },
            {
                path: 'stat',
                name: 'stat',
                component: () => import("@/views/stat"),
            },
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import("@/views/login"),
    },
    {
        path: '*',
        name: "404",
        component: () => import('@/views/NoFound'),
    }
]


const router = new VueRouter({
    mode: 'hash',
    routes: staticRoutes
})

console.log("初始化router：");
console.log(router.getRoutes());




export default router